Skip to content

Fixes Cmake error "file called with network path DESTINATION" #2376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

vgorloff
Copy link
Contributor

This PR fixes install step failure:

...
-- Installing: /Install/armv7a/swift-corelibs-foundation/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h
-- Installing: /Install/armv7a/swift-corelibs-foundation/lib/swift/CoreFoundation/module.map
-- Installing: /Install/armv7a/swift-corelibs-foundation/lib/swift/CFURLSessionInterface
-- Installing: /Install/armv7a/swift-corelibs-foundation/lib/swift/CFURLSessionInterface/CFURLSessionInterface.h
-- Installing: /Install/armv7a/swift-corelibs-foundation/lib/swift/CFURLSessionInterface/module.map
-- Installing: /Install/armv7a/swift-corelibs-foundation/usr/lib/libCoreFoundation.a
-- Installing: /Install/armv7a/swift-corelibs-foundation/usr/lib/libCFURLSessionInterface.a
CMake Error at CoreFoundation/cmake_install.cmake:73 (file):
  file called with network path DESTINATION.  This does not make sense when
  using DESTDIR.  Specify local absolute path or remove DESTDIR environment
  variable.

  DESTINATION=

  //System/Library/Frameworks
Call Stack (most recent call first):
  cmake_install.cmake:74 (include)


FAILED: CMakeFiles/install.util
cd /Build/armv7a/swift-corelibs-foundation && /Volumes/Data/Developer/Brew/Cellar/cmake/3.14.5/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.

Here is a contents of file /Build/CoreFoundation/cmake_install.cmake

...
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
   "//System/Library/Frameworks/CFURLSessionInterface.framework")
  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
  endif()
  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
  endif()
file(INSTALL DESTINATION "//System/Library/Frameworks" TYPE DIRECTORY FILES "/ToolChain/Build/armv7a/swift-corelibs-foundation/CFURLSessionInterface.framework" USE_SOURCE_PERMISSIONS REGEX "/privateheaders$" EXCLUDE)
endif()

As you can see there is a double slash // in install destination. This cause CMake error. So, we need to avoid such case by performing RegEx replace when CMAKE_INSTALL_PREFIX set to /. Usually CMAKE_INSTALL_PREFIX set to / when whole installation relocated with DESTDIR option.

@vgorloff
Copy link
Contributor Author

@swift-ci please test

@spevans
Copy link
Contributor

spevans commented Jun 24, 2019

@swift-ci test linux

@spevans spevans requested a review from compnerd June 24, 2019 21:46
@compnerd
Copy link
Member

I believe we do something similar in libdispatch and XCTest

@vgorloff
Copy link
Contributor Author

Seems like we already can merge this PR. Should we?

@compnerd
Copy link
Member

Please wait for the android build to get fixed first. See #2379

@compnerd compnerd merged commit 6aa1f7e into swiftlang:master Jun 26, 2019
vgorloff added a commit to vgorloff/swift-everywhere-toolchain that referenced this pull request Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants